Integrand size = 31, antiderivative size = 101 \[ \int \frac {(a+i a \tan (e+f x))^4}{(c-i c \tan (e+f x))^2} \, dx=\frac {6 a^4 x}{c^2}-\frac {6 i a^4 \log (\cos (e+f x))}{c^2 f}-\frac {a^4 \tan (e+f x)}{c^2 f}-\frac {4 i a^4}{f (c-i c \tan (e+f x))^2}+\frac {12 i a^4}{f \left (c^2-i c^2 \tan (e+f x)\right )} \]
6*a^4*x/c^2-6*I*a^4*ln(cos(f*x+e))/c^2/f-a^4*tan(f*x+e)/c^2/f-4*I*a^4/f/(c -I*c*tan(f*x+e))^2+12*I*a^4/f/(c^2-I*c^2*tan(f*x+e))
Time = 3.54 (sec) , antiderivative size = 62, normalized size of antiderivative = 0.61 \[ \int \frac {(a+i a \tan (e+f x))^4}{(c-i c \tan (e+f x))^2} \, dx=\frac {i a^4 \left (6 \log (i+\tan (e+f x))+i \tan (e+f x)+\frac {-8+12 i \tan (e+f x)}{(i+\tan (e+f x))^2}\right )}{c^2 f} \]
(I*a^4*(6*Log[I + Tan[e + f*x]] + I*Tan[e + f*x] + (-8 + (12*I)*Tan[e + f* x])/(I + Tan[e + f*x])^2))/(c^2*f)
Time = 0.37 (sec) , antiderivative size = 82, normalized size of antiderivative = 0.81, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {3042, 4005, 3042, 3968, 49, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {(a+i a \tan (e+f x))^4}{(c-i c \tan (e+f x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a+i a \tan (e+f x))^4}{(c-i c \tan (e+f x))^2}dx\) |
\(\Big \downarrow \) 4005 |
\(\displaystyle a^4 c^4 \int \frac {\sec ^8(e+f x)}{(c-i c \tan (e+f x))^6}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle a^4 c^4 \int \frac {\sec (e+f x)^8}{(c-i c \tan (e+f x))^6}dx\) |
\(\Big \downarrow \) 3968 |
\(\displaystyle \frac {i a^4 \int \frac {(i \tan (e+f x) c+c)^3}{(c-i c \tan (e+f x))^3}d(-i c \tan (e+f x))}{c^3 f}\) |
\(\Big \downarrow \) 49 |
\(\displaystyle \frac {i a^4 \int \left (\frac {8 c^3}{(c-i c \tan (e+f x))^3}-\frac {12 c^2}{(c-i c \tan (e+f x))^2}+\frac {6 c}{c-i c \tan (e+f x)}-1\right )d(-i c \tan (e+f x))}{c^3 f}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {i a^4 \left (-\frac {4 c^3}{(c-i c \tan (e+f x))^2}+\frac {12 c^2}{c-i c \tan (e+f x)}+i c \tan (e+f x)+6 c \log (c-i c \tan (e+f x))\right )}{c^3 f}\) |
(I*a^4*(6*c*Log[c - I*c*Tan[e + f*x]] + I*c*Tan[e + f*x] - (4*c^3)/(c - I* c*Tan[e + f*x])^2 + (12*c^2)/(c - I*c*Tan[e + f*x])))/(c^3*f)
3.10.31.3.1 Defintions of rubi rules used
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int [ExpandIntegrand[(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && IGtQ[m, 0] && IGtQ[m + n + 2, 0]
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_ ), x_Symbol] :> Simp[1/(a^(m - 2)*b*f) Subst[Int[(a - x)^(m/2 - 1)*(a + x )^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Simp[a^m*c^m Int[Sec[e + f*x]^(2*m)*(c + d*Tan[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && EqQ[ b*c + a*d, 0] && EqQ[a^2 + b^2, 0] && IntegerQ[m] && !(IGtQ[n, 0] && (LtQ[ m, 0] || GtQ[m, n]))
Time = 0.28 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.04
method | result | size |
derivativedivides | \(-\frac {a^{4} \tan \left (f x +e \right )}{c^{2} f}+\frac {6 a^{4} \arctan \left (\tan \left (f x +e \right )\right )}{f \,c^{2}}+\frac {3 i a^{4} \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{f \,c^{2}}+\frac {4 i a^{4}}{f \,c^{2} \left (\tan \left (f x +e \right )+i\right )^{2}}-\frac {12 a^{4}}{f \,c^{2} \left (\tan \left (f x +e \right )+i\right )}\) | \(105\) |
default | \(-\frac {a^{4} \tan \left (f x +e \right )}{c^{2} f}+\frac {6 a^{4} \arctan \left (\tan \left (f x +e \right )\right )}{f \,c^{2}}+\frac {3 i a^{4} \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{f \,c^{2}}+\frac {4 i a^{4}}{f \,c^{2} \left (\tan \left (f x +e \right )+i\right )^{2}}-\frac {12 a^{4}}{f \,c^{2} \left (\tan \left (f x +e \right )+i\right )}\) | \(105\) |
risch | \(-\frac {i a^{4} {\mathrm e}^{4 i \left (f x +e \right )}}{c^{2} f}+\frac {4 i a^{4} {\mathrm e}^{2 i \left (f x +e \right )}}{c^{2} f}-\frac {12 a^{4} e}{f \,c^{2}}-\frac {2 i a^{4}}{f \,c^{2} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}-\frac {6 i a^{4} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{f \,c^{2}}\) | \(105\) |
norman | \(\frac {\frac {8 i a^{4}}{c f}+\frac {6 a^{4} x}{c}+\frac {12 a^{4} x \left (\tan ^{2}\left (f x +e \right )\right )}{c}+\frac {6 a^{4} x \left (\tan ^{4}\left (f x +e \right )\right )}{c}-\frac {5 a^{4} \tan \left (f x +e \right )}{c f}-\frac {14 a^{4} \left (\tan ^{3}\left (f x +e \right )\right )}{c f}-\frac {a^{4} \left (\tan ^{5}\left (f x +e \right )\right )}{c f}+\frac {16 i a^{4} \left (\tan ^{2}\left (f x +e \right )\right )}{c f}}{c \left (1+\tan ^{2}\left (f x +e \right )\right )^{2}}+\frac {3 i a^{4} \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{f \,c^{2}}\) | \(172\) |
-a^4*tan(f*x+e)/c^2/f+6/f*a^4/c^2*arctan(tan(f*x+e))+3*I/f*a^4/c^2*ln(1+ta n(f*x+e)^2)+4*I/f*a^4/c^2/(tan(f*x+e)+I)^2-12/f*a^4/c^2/(tan(f*x+e)+I)
Time = 0.24 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.04 \[ \int \frac {(a+i a \tan (e+f x))^4}{(c-i c \tan (e+f x))^2} \, dx=\frac {-i \, a^{4} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 i \, a^{4} e^{\left (4 i \, f x + 4 i \, e\right )} + 4 i \, a^{4} e^{\left (2 i \, f x + 2 i \, e\right )} - 2 i \, a^{4} - 6 \, {\left (i \, a^{4} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, a^{4}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{c^{2} f e^{\left (2 i \, f x + 2 i \, e\right )} + c^{2} f} \]
(-I*a^4*e^(6*I*f*x + 6*I*e) + 3*I*a^4*e^(4*I*f*x + 4*I*e) + 4*I*a^4*e^(2*I *f*x + 2*I*e) - 2*I*a^4 - 6*(I*a^4*e^(2*I*f*x + 2*I*e) + I*a^4)*log(e^(2*I *f*x + 2*I*e) + 1))/(c^2*f*e^(2*I*f*x + 2*I*e) + c^2*f)
Time = 0.28 (sec) , antiderivative size = 155, normalized size of antiderivative = 1.53 \[ \int \frac {(a+i a \tan (e+f x))^4}{(c-i c \tan (e+f x))^2} \, dx=- \frac {2 i a^{4}}{c^{2} f e^{2 i e} e^{2 i f x} + c^{2} f} - \frac {6 i a^{4} \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{c^{2} f} + \begin {cases} \frac {- i a^{4} c^{2} f e^{4 i e} e^{4 i f x} + 4 i a^{4} c^{2} f e^{2 i e} e^{2 i f x}}{c^{4} f^{2}} & \text {for}\: c^{4} f^{2} \neq 0 \\\frac {x \left (4 a^{4} e^{4 i e} - 8 a^{4} e^{2 i e}\right )}{c^{2}} & \text {otherwise} \end {cases} \]
-2*I*a**4/(c**2*f*exp(2*I*e)*exp(2*I*f*x) + c**2*f) - 6*I*a**4*log(exp(2*I *f*x) + exp(-2*I*e))/(c**2*f) + Piecewise(((-I*a**4*c**2*f*exp(4*I*e)*exp( 4*I*f*x) + 4*I*a**4*c**2*f*exp(2*I*e)*exp(2*I*f*x))/(c**4*f**2), Ne(c**4*f **2, 0)), (x*(4*a**4*exp(4*I*e) - 8*a**4*exp(2*I*e))/c**2, True))
Exception generated. \[ \int \frac {(a+i a \tan (e+f x))^4}{(c-i c \tan (e+f x))^2} \, dx=\text {Exception raised: RuntimeError} \]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 206 vs. \(2 (91) = 182\).
Time = 0.61 (sec) , antiderivative size = 206, normalized size of antiderivative = 2.04 \[ \int \frac {(a+i a \tan (e+f x))^4}{(c-i c \tan (e+f x))^2} \, dx=-\frac {\frac {6 i \, a^{4} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{c^{2}} - \frac {12 i \, a^{4} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}{c^{2}} + \frac {6 i \, a^{4} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{c^{2}} - \frac {2 \, {\left (3 i \, a^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + a^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 3 i \, a^{4}\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )} c^{2}} + \frac {25 i \, a^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 108 \, a^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 182 i \, a^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 108 \, a^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 25 i \, a^{4}}{c^{2} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}^{4}}}{f} \]
-(6*I*a^4*log(tan(1/2*f*x + 1/2*e) + 1)/c^2 - 12*I*a^4*log(tan(1/2*f*x + 1 /2*e) + I)/c^2 + 6*I*a^4*log(tan(1/2*f*x + 1/2*e) - 1)/c^2 - 2*(3*I*a^4*ta n(1/2*f*x + 1/2*e)^2 + a^4*tan(1/2*f*x + 1/2*e) - 3*I*a^4)/((tan(1/2*f*x + 1/2*e)^2 - 1)*c^2) + (25*I*a^4*tan(1/2*f*x + 1/2*e)^4 - 108*a^4*tan(1/2*f *x + 1/2*e)^3 - 182*I*a^4*tan(1/2*f*x + 1/2*e)^2 + 108*a^4*tan(1/2*f*x + 1 /2*e) + 25*I*a^4)/(c^2*(tan(1/2*f*x + 1/2*e) + I)^4))/f
Time = 5.18 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.89 \[ \int \frac {(a+i a \tan (e+f x))^4}{(c-i c \tan (e+f x))^2} \, dx=-\frac {\frac {12\,a^4\,\mathrm {tan}\left (e+f\,x\right )}{c^2}+\frac {a^4\,8{}\mathrm {i}}{c^2}}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^2+\mathrm {tan}\left (e+f\,x\right )\,2{}\mathrm {i}-1\right )}-\frac {a^4\,\mathrm {tan}\left (e+f\,x\right )}{c^2\,f}+\frac {a^4\,\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,6{}\mathrm {i}}{c^2\,f} \]